<template>
  <div>
     <el-button @click="fn()" type="danger">添加</el-button>
      <v-add :obj="obj" ref="oCh"></v-add>
      <v-list @fn1="fn1"></v-list>
  </div>
</template>

<script>
import vAdd from "./components/add.vue"
import vList from "./components/list.vue"
export default {
  data() {
    return {
     obj:{
        flag:false,
        isTrue:true
     }
    };
  },
components:{
  vAdd,
  vList
},
methods:{
  fn(){
    this.obj.flag=true
     this.obj.isTrue=true
  },
  //点击添加
  aa(){
  this.obj.flag=false
  this.obj.isTrue=true
},
//在list点击了编辑
fn1(id){
  this.obj.flag=true
  this.obj.isTrue=false
  this.$refs.oCh.getOne(id)
}
  
},

}
</script>

<style>

</style>